<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script>
			//题目1
					var mydate = new Date();
					mydate.getFullYear();
					mydate.getMonth();
					mydate.getDay();
					mydate.getDate();
					mydate.getHours();
					mydate.getMinutes();
					mydate.getSeconds();
					mydate.toLocaleDateString();
					mydate.toLocaleTimeString();
					var local = mydate.toLocaleString();
					//document.write(mydate.getDay()+'<br/>');
					//document.write(local);

			//题目2
					var age1 = 28;
					var age2 = 30;

					var res = Math.abs(age1-age2);

					//alert( '他俩相差了' + res + '岁' );  //修改


			//题目3


					/*var email = 'test@163.com';
					var pos = email.indexOf("@");
					var user = email.substr(0,pos);
					alert(user);*/


			//题目4

					/*var str = "hello world";
					while(str.indexOf("o") != -1){
						str = str.replace("o","a");
					}

					alert(str);*/

			//题目5

				//5、学生考试成绩，我想知道有多少人及格，有多少人不及格？

				var score = [69,34,29,90,59,70,85];
				var pass = 0;
				var fail = 0;

				for(var i =0;i<=score.length;i++){

					if(score[i] <60){
						fail++;
					}else{
						pass++;
					}


				}

				//document.write("有"+pass+"人及格");
				//document.write("有"+fail+"人不及格");



			//题目6
			/*
			*@str 转化字符串
			*@changstr 被转化的字符串
			*@changmode 转化为大写或者是小写
			*/

				/*function change(str,changstr,changmode){
					var res ="";
					for(var i=0;i<str.length;i++){
			         		if(str[i] == changstr){
			         			
			         			if(changmode == "up"){
			         				res +=str[i].toUpperCase();
			         			}else{
			         				res +=str[i].toLowerCase();
			         			}

			         		}else{
			         			res +=str[i];
			         		}
			         }

			         return res;

				}


				document.write(change("AAAAAAAA","A","lower"));*/


	</script>
</head>
<body>
	
</body>
</html>